package com.zkdcloud.repository;

import com.zkdcloud.domain.FeedBack;
import org.jfaster.mango.annotation.DB;
import org.jfaster.mango.annotation.SQL;
import org.jfaster.mango.plugin.page.Page;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zk123
 * @version 2018/5/24
 */
@DB(table = "feedback")
@Repository
public interface FeedbackDao {
    String COLUMNS = "id,content,contact_way,create_time";

    /**
     * 添加反馈
     *
     * @param feedBack 反馈
     */
    @SQL("insert into #table("+COLUMNS+")values(:id,:content,:contactWay,:createTime)")
    void add(FeedBack feedBack);

    /**
     * 反馈分页列表
     *
     * @param page page
     * @return list
     */
    @SQL("select * from #table")
    List<FeedBack> getAll(Page page);
}
